{{list using='{$items}' parity='{$parity}'}}

  {{include file="_admin/selectors.phtml"/}}
  {{include file="_admin_object/actions.phtml"/}}

  <div class="list" id="documents">
    <div class='list_actions'>
      {{apply template="selectors_button" action="delete" title="Удалить" /}}
      {{apply template="save_priority_button" controller="admin_document" action="priority" params="parent_id={$#item.id}"/}}
    </div>
    <table>
      <tr>
        <th>{{apply template="selectors_toggler"/}}</th>
        <th>#ID</th>
        <th>Порядок</th>
        <th>Название</th>
        <th>Статус</th>
        <th>Дата<br/>создания</th>
        <th>Последнее<br/>обновление</th>
        <th>Действия</th>
      </tr>
      {{list:item}}
      <tr class='{$parity}'>
        <td>{{apply template="selector" value="{$item.id}"/}}</td>
        <td>#{$item.id}</td>
        <td>{{include file="_admin/priority_input.phtml" item="$item"/}}</td>
        <td width="80%">
          <a href='{{route_url params="action:display,id:{$item.id}"/}}' title="Просмотр дочерних документов" style="font-weight:bold;">{$item.title}</a> ({$item.kids->count()})
          <br/>[<a href="{$item.uri}" title="Посмотреть на сайте" target="_blank">{$item.uri}</a>]
        </td>
        <td><? echo $item->getIsPublished() ? '<img src="/shared/cms/images/icons/lightbulb.png" title="Опубликована"/>' : '<img src="/shared/cms/images/icons/lightbulb_off.png" title="Скрыта"/>'; ?></td>
        <td>{$item.ctime|i18n_date:"", "stamp", "short_date_time"}</td>
        <td>{$item.utime|i18n_date:"", "stamp", "short_date_time"}</td>
        <td class='actions'>
          {{apply template="object_action" item="{$item}" action="create" title="Добавление дочернего документа" icon="page_add"/}}
          <? if($item->getIsPublished()): ?>
            {{apply template="object_action_unpublish" item="{$item}" icon="lightbulb_off"/}}
          <?  else:  ?>
            {{apply template="object_action_publish" item="{$item}" icon="lightbulb"/}}
          <? endif; ?>
          {{apply template="object_action_edit" item="{$item}" icon="page_edit"/}}
          {{apply template="object_action_delete" item="{$item}"/}}
        </td>
      </tr>
      {{/list:item}}
      {{list:empty}}
        <div class="empty_list">Документы отсутствуют</div>
      {{/list:empty}}
    </table>
    <div class='list_actions'>
      {{apply template="selectors_button" action="delete" title="Удалить" /}}
      {{apply template="save_priority_button" controller="admin_document" action="priority" params="parent_id={$#item.id}"/}}
    </div>
  </div>

{{/list}}
